Skip to content

Conversation

@aerfrei
Copy link
Contributor

@aerfrei aerfrei commented Nov 20, 2025

This change the default initial scan behavior for db-level feeds to not do an initial scan if no option is specified. When an option is specified for initial scan, it is respected.

This includes a rewrite of existing db-level feeds tests which rely on default initial scans in their testing.

Epic: CRDB-1421
Informs: #156484

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aerfrei aerfrei force-pushed the db-level-feeds-no-initial-scan-by-default branch 4 times, most recently from dd5ef63 to 10a5244 Compare November 20, 2025 03:23
@aerfrei
Copy link
Contributor Author

aerfrei commented Nov 20, 2025

Self review link

@aerfrei aerfrei requested review from KeithCh and asg0451 November 20, 2025 13:40
@aerfrei aerfrei marked this pull request as ready for review November 20, 2025 13:40
@aerfrei aerfrei requested a review from a team as a code owner November 20, 2025 13:40
`foo: [0]->{"after": {"a": 0, "b": "initial"}}`,
`bar: [1]->{"after": {"a": 1, "b": "initial"}}`,
})
// Database level changefeeds do not perform an initial scan.
Copy link
Contributor

@KeithCh KeithCh Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably remove this unless we explicitly check that the payload doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to remove the comment or not to add the rows in the first place? FWIW, we do check them for the table level feed that is started in this test.

I'm not sure adding the rows adds so much to the test, but I don't think it hurts. And if we keep it around, I think it's worth keeping the comment to explain the difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the comment to make this clearer. I guess I could also just explicitly specify WITH initial_scan='yes' for the db-level changefeed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant remove the comment

@aerfrei aerfrei force-pushed the db-level-feeds-no-initial-scan-by-default branch from 10a5244 to a3a7c8c Compare November 20, 2025 19:09
This change the default initial scan behavior for db-level
feeds to not do an initial scan if no option is specified.
When an initial scan is specified, that is respected.
We do not allow db-level changefeeds with initial_scan='only'.

This includes a rewrite of existing db-level feeds tests which
rely on default initial scans in their testing.

Epic: CRDB-1421
Informs: cockroachdb#156484

Release note: None
@aerfrei aerfrei force-pushed the db-level-feeds-no-initial-scan-by-default branch from a3a7c8c to aa79556 Compare November 20, 2025 19:16
@aerfrei
Copy link
Contributor Author

aerfrei commented Nov 20, 2025

TFTR!

bors r=KeithCh,asg0451

@craig
Copy link
Contributor

craig bot commented Nov 20, 2025

@craig craig bot merged commit a652bfc into cockroachdb:master Nov 20, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants